package com.cbts.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
/**
 * Rule entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "rule", catalog = "cbts", uniqueConstraints = @UniqueConstraint(columnNames = "ruleName"))
public class Rule implements java.io.Serializable {

	// Fields

	private Integer ruleId;
	private String ruleName;
	private Double rate;

	// Constructors

	/** default constructor */
	public Rule() {
		rate=0.50;
	}

	/** full constructor */
	public Rule(Integer ruleId, String ruleName, Double rate) {
		this.ruleId = ruleId;
		this.ruleName = ruleName;
		this.rate = rate;
	}

	// Property accessors
	@Id
	@Column(name = "ruleId", unique = true, nullable = false)
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Integer getRuleId() {
		return this.ruleId;
	}

	public void setRuleId(Integer ruleId) {
		this.ruleId = ruleId;
	}

	@Column(name = "ruleName", unique = true, nullable = false, length = 25)
	public String getRuleName() {
		return this.ruleName;
	}

	public void setRuleName(String ruleName) {
		this.ruleName = ruleName;
	}

	@Column(name = "rate", nullable = false, precision = 11)
	public Double getRate() {
		return this.rate;
	}

	public void setRate(Double rate) {
		this.rate = rate;
	}

}